package com.qingfeng.medical.controller.front.order;

import com.qingfeng.medical.base.controller.BaseController;
import com.qingfeng.medical.base.log.annotation.Log;
import com.qingfeng.medical.base.log.enums.BusinessType;
import com.qingfeng.medical.base.result.Result;
import com.qingfeng.medical.biz.order.domain.entity.RefundInfo;
import com.qingfeng.medical.biz.order.service.RefundInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;




/**
 * 退款信息表
 *
 * @author 清风学Java
 * @date 2023-05-11 13:43:47
 */
@Api(tags = "退款信息表管理")
@RestController
@RequestMapping("/api/info/RefundInfo")
@CrossOrigin
@Validated
public class RefundInfoApiController  extends BaseController {

    @Autowired
    private RefundInfoService refundInfoService;

    @ApiOperation(value = "退款信息表分页列表", notes = "退款信息表分页列表")
    @GetMapping("/list")
    @Log(title = "退款信息表", businessType = BusinessType.SELECT, message = "退款信息表分页列表")
    public Result list(){

        return Result.ok();
    }

    @ApiOperation(value = "退款信息表信息", notes = "退款信息表信息")
    @GetMapping("/info/{id}")
    @Log(title = "退款信息表", businessType = BusinessType.SELECT, message = "退款信息表信息")
    public Result info(@PathVariable("id") Integer id){
		RefundInfo refundInfo = refundInfoService.getById(id);

        return Result.ok();
    }

    @ApiOperation(value = "保存退款信息表信息", notes = "保存退款信息表信息")
    @PostMapping("/save")
    @Log(title = "退款信息表", businessType = BusinessType.SELECT, message = "保存退款信息表信息")
    public Result save(@RequestBody RefundInfo refundInfo){
		refundInfoService.save(refundInfo);

        return Result.ok();
    }

    @ApiOperation(value = "修改退款信息表信息", notes = "修改退款信息表信息")
    @PutMapping("/update")
    @Log(title = "退款信息表", businessType = BusinessType.SELECT, message = "修改退款信息表信息")
    public Result update(@RequestBody RefundInfo refundInfo){
		refundInfoService.updateById(refundInfo);

        return Result.ok();
    }

    @ApiOperation(value = "删除退款信息表信息", notes = "删除退款信息表信息")
    @DeleteMapping("/delete")
    @Log(title = "退款信息表", businessType = BusinessType.SELECT, message = "删除退款信息表信息")
    public Result delete(@RequestBody Integer[] ids){
		refundInfoService.removeByIds(Arrays.asList(ids));

        return Result.ok();
    }

}
